<template>
  <Header title="邻里社区" :show-back="false" v-if="!$route.meta.hideHeader" >
  </Header>
  <div class="app-container">
    <div class="main-content">
      <router-view />
    </div>
  </div>
  <TabBar v-if="!$route.meta.hideTabBar" />
</template>

<script setup lang="ts">
import TabBar from '@/components/TabBar.vue';
import Header from "@/components/Header.vue";
import { RouterView } from 'vue-router'
import { useRouter } from 'vue-router'

const router = useRouter()

/*onMounted(() => {
  if (window.location.hash === '#/' || window.location.pathname === '/') {
    router.replace('/login')
  }
})*/

</script>

<style>
/* 引入全局样式文件，确保所有组件共享相同的视觉风格 */
@import url('style.css');

.app-container {
  /* 使用 CSS 变量设置背景色 */
  background-color: var(--background);
  /* 确保内容能填充整个视口 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  /* 让主内容区域占据剩余空间 */
  flex-grow: 1;
}
</style>